***********************************************************************
* Information asymmetry, financial intermediation, and wealth effects 
* of project finance loans (Oct 2021)
***********************************************************************
set more off
version 16
clear *
set maxvar 7000

******************************************************************************
* PREPARE DATASETS
******************************************************************************

// Merge datasets and construct variables

* Creat stock returns and bid-ask spread dataset
use sample_dates.dta, clear
merge 1:1 fid day using prices.dta, nogen
merge 1:1 fid day using mve.dta, nogen
merge 1:1 fid day using ask.dta, nogen
merge 1:1 fid day using bid.dta, nogen
by fid: gen lret=log(price[_n]/price[_n-1])
by fid: gen ba_spread=(ask-bid)/((ask+bid)/2)
save stock.dta, replace

* Create index returns dataset
use index.dta, clear
gen lmkret=log(allord[_n]/allord[_n-1])
gen lsmret=log(smord[_n]/smord[_n-1])
save index1.dta, replace

* Merge firm returns and index returns 
use stock.dta, clear
merge m:1 Date using index1.dta, keep(match master) nogen
sort fid Date
gen lmkadj=lret-lmkret
gen lsmadj=lret-lsmret
save return.dta, replace

// Prepare all announcement sample dataset
use pf_sample.dta, clear

* Exclude convertible loans and obs with missing stock price data
drop if convert==1 	
drop if id1==19		
drop if id1==21
drop if id1==129
drop if id1==134
drop if id1==260
drop if id1==312

* Construct firm, loan and project variables
rename evdate Date
merge 1:1 fid Date using sample_dates.dta, keep(match master) nogen
order day, after(Date)
replace day=day-2	/* for extracting MVE 2 days before event date */

merge 1:1 fid day using mve.dta, keep(match master) nogen
replace mve=mve*1000000
gen loan_ta=loan/ta
gen loan_mve=loan/mve
gen lnmve=log(mve)
replace day=day+2
order mve lnmve loan_ta loan_mve, after(bve)
gen loss=1 if npat<0
replace loss=0 if loss==.
gen spbank1=1 if mqbank==1
gen spbank3=1 if mqbank==1 | inv_roth==1 | bos==1
replace spbank1=0 if spbank1==.
replace spbank3=0 if spbank3==.
order loss, after(npat)
order spbank1 spbank3, after(rmb)

gen gpu=1-prs
order gpu, after(prs)
summarize prs, detail
gen higpu=1 if prs<=r(p50)
replace higpu=0 if higpu==.
order higpu, after(gpu)

merge m:1 evyr using cpi.dta, keep(match master) keepusing(deflate2014) nogen
sort id1
order deflate2014, after(evyr)
gen loan_r=loan/deflate2014
gen ta_r=ta/deflate2014
gen mve_r=mve/deflate2014	
gen rev_ta=rev/ta
gen cash_ta=cash/ta
gen npat_bve=npat/bve
gen std_ta=std/ta
gen ltd_ta=ltd/ta
gen td=std + ltd
gen td_ta=td/ta
gen mtb=mve/bve

save allann.dta, replace

// Prepare first-or-sole approval sample datasets

keep if fstsoapp==1
save fstsoapp.dta, replace

******************************************************************************
* DESCRIPTIVE STATISTICS
******************************************************************************

// Table 1: Announcements by type
use allann.dta, clear
tabstat mention mandate fstapp revisapp fnlapp soleapp draw, ///
	stat(N sum mean) col(stat) 

// Figure 1: Distribution of PF deals by year
use fstsoapp.dta, clear
graph bar (count) fstsoapp, over(evyr)

// Table 2: PF deals by commodity type and project country
tab country comm

// Table 3: Lender participation in PF deals
tab lender1
tab lender2
tab lender3
tab lender4
tab lender5
tab lender6
tab lender7
tab lender8

// Table 4: Summary statitics
* Panel A: Loan characteristics
tabstat lenders loan_r loan_ta loan_mve, ///
	stat(N mean p50 sd min p25 p75 max) col(stat) 
tabstat jv foreign syndic bank nonbank mixed spbank1 spbank3 offtake hedging ///
	secured eq_raise lender_eq, stat(N sum mean) col(stat) 

* Panel B: Firm characteristics	
tabstat ta_r mve_r rev_ta cash_ta npat_bve std_ta ltd_ta td_ta mtb top20 ///
	ceo_shdg dir_shdg mgnt_shdg, stat(N mean p50 sd min p25 p75 max) col(stat) 

******************************************************************************
* MARKET REACTIONS
******************************************************************************
use allann.dta, clear

// Stock price responses (All ordinaries index as benchmark)
	
* All announcements
eventstudy2 fid Date using return.dta, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_all) cross(cross_all) replace
	
* Mentions
eventstudy2 fid Date using return.dta if mention==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_mention) cross(cross_mention) replace

* Mandates
eventstudy2 fid Date using return.dta if mandate==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_mandate) cross(cross_mandate) replace

* First approvals
eventstudy2 fid Date using return.dta if fstapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fstapp) cross(cross_fstapp) replace

* Revised approvals
eventstudy2 fid Date using return.dta if revisapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_revisapp) cross(cross_revisapp) replace
	
* Final approvals
eventstudy2 fid Date using return.dta if fnlapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fnlapp) cross(cross_fnlapp) replace
		
* Sole approvals
eventstudy2 fid Date using return.dta if soleapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_soleapp) cross(cross_soleapp) replace

* First-or-sole approvals
eventstudy2 fid Date using return.dta if fstsoapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fstsoapp) cross(cross_fstsoapp) replace

* Final-or-sole approvals
eventstudy2 fid Date using return.dta if fnlsoapp==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fnlsoapp) cross(cross_fnlsoapp) replace

* Drawdowns	
eventstudy2 fid Date using return.dta if draw==1, ret(lmkadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_draw) cross(cross_draw) replace

erase aarfile.dta 
erase arfile.dta 
erase diagnosticsfile.dta 
erase diagnosticsfile.smcl 
erase graphfile.gph
	
// Table 5 Panel A: All Ordinaries index-adjusted abnormal returns

* All announcements
use cross_all.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_all.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mentions
use cross_mention.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_mention.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mandates
use cross_mandate.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_mandate.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First approvals
use cross_fstapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fstapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Revised approvals
use cross_revisapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_revisapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final approvals
use cross_fnlapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fnlapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Sole approvals
use cross_soleapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_soleapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First-or-sole approvals
use cross_fstsoapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fstsoapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final-or-sole approvals
use cross_fnlsoapp.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fnlsoapp.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Drawdowns
use cross_draw.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_draw.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

// Stock price responses (Small ordinaries index as benchmark)

use allann.dta, clear

* All announcements
eventstudy2 fid Date using return.dta, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_all_sm) cross(cross_all_sm) replace
	
* Mentions
eventstudy2 fid Date using return.dta if mention==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_mention_sm) cross(cross_mention_sm) replace

* Mandates
eventstudy2 fid Date using return.dta if mandate==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_mandate_sm) cross(cross_mandate_sm) replace

* First approvals
eventstudy2 fid Date using return.dta if fstapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fstapp_sm) cross(cross_fstapp_sm) replace

* Revised approvals
eventstudy2 fid Date using return.dta if revisapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_revisapp_sm) cross(cross_revisapp_sm) replace
	
* Final approvals
eventstudy2 fid Date using return.dta if fnlapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fnlapp_sm) cross(cross_fnlapp_sm) replace
		
* Sole approvals
eventstudy2 fid Date using return.dta if soleapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_soleapp_sm) cross(cross_soleapp_sm) replace

* First-or-sole approvals
eventstudy2 fid Date using return.dta if fstsoapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fstsoapp_sm) cross(cross_fstsoapp_sm) replace

* Final-or-sole approvals
eventstudy2 fid Date using return.dta if fnlsoapp==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_fnlsoapp_sm) cross(cross_fnlsoapp_sm) replace

* Drawdowns	
eventstudy2 fid Date using return.dta if draw==1, ret(lsmadj) log ///
	car1LB(-1) car1UB(1) evwlb(-1) evwub(1) ///
	car(caar_draw_sm) cross(cross_draw_sm) replace

erase aarfile.dta 
erase arfile.dta 
erase diagnosticsfile.dta 
erase diagnosticsfile.smcl 
erase graphfile.gph	
	
// Table 5 Panel B: Small Ordinaries index-adjusted abnormal returns	
	
* All announcements
use cross_all_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_all_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mentions
use cross_mention_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_mention_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mandates
use cross_mandate_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_mandate_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First approvals
use cross_fstapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fstapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Revised approvals
use cross_revisapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_revisapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final approvals
use cross_fnlapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fnlapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Sole approvals
use cross_soleapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_soleapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First-or-sole approvals
use cross_fstsoapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fstsoapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final-or-sole approvals
use cross_fnlsoapp_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_fnlsoapp_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Drawdowns
use cross_draw_sm.dta, clear
rename CAR1 CAAR
gen pos_CAAR=(CAAR>0)
tabstat pos_CAAR, stat(N sum mean)
use caar_draw_sm.dta, clear
rename CAARE CAAR
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAR BMP_test BMP_pval CZ_rank CZ_pval if _n==1

// Table 6: Stock price responses to PF announcements by hedging requirements, 
// lender identity and political uncertainty

use cross_all.dta, clear
drop CAR2 CAR3 CAR4 CAR5 CAR6 CAR7 CAR8 CAR9 CAR10
rename CAR1 CAR
gen poscar=(CAR>0)
save cross_all1.dta, replace

* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if mention==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if mandate==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if fstapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if revisapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if fnlapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if soleapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if fstsoapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if fnlsoapp==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)

use cross_all1.dta, clear
keep if draw==1
* hedging vs. no hedging
tab poscar if hedging1==1
tab poscar if hedging1==0
tabstat CAR, by(hedging1) stat(N mean p50) col(stat)
ttest CAR, by(hedging1)
ranksum CAR, by(hedging1)
* specialist vs. non-specialist bank
tab poscar if spbank3==1
tab poscar if spbank3==0
tabstat CAR, by(spbank3) stat(N mean p50) col(stat)
ttest CAR, by(spbank3)
ranksum CAR, by(spbank3)
* high GPU vs. low GPU
tab poscar if higpu==1
tab poscar if higpu==0
tabstat CAR, by(higpu) stat(N mean p50) col(stat)
ttest CAR, by(higpu)
ranksum CAR, by(higpu)
	
// Bid-ask spread responses

use allann.dta, clear

* All announcements
eventstudy2 fid Date using return.dta, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_all) cross(cross_sp_all) replace		

* Mentions
eventstudy2 fid Date using return.dta if mention==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_mention) cross(cross_sp_mention) replace

* Mandates
eventstudy2 fid Date using return.dta if mandate==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_mandate) cross(cross_sp_mandate) replace

* First approvals
eventstudy2 fid Date using return.dta if fstapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_fstapp) cross(cross_sp_fstapp)replace

* Revised approvals
eventstudy2 fid Date using return.dta if revisapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_revisapp) cross(cross_sp_revisapp) replace
	
* Final approvals
eventstudy2 fid Date using return.dta if fnlapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_fnlapp) cross(cross_sp_fnlapp) replace
		
* Sole approvals
eventstudy2 fid Date using return.dta if soleapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_soleapp) cross(cross_sp_soleapp) replace
	
* First-or-sole approvals
eventstudy2 fid Date using return.dta if fstsoapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_fstsoapp) cross(cross_sp_fstsoapp) replace

* Final-or-sole approvals
eventstudy2 fid Date using return.dta if fnlsoapp==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_fnlsoapp) cross(cross_sp_fnlsoapp) replace

* Drawdowns	
eventstudy2 fid Date using return.dta if draw==1, ret(ba_spread) ///
	car1LB(-1) car1UB(1) mod(COMEAN) evwlb(-1) evwub(1) ///
	eswlb(-100) eswub(-15) minevw(1) minesw(30) ///
	car(caas_sp_draw) cross(cross_sp_draw) replace

erase aarfile.dta 
erase arfile.dta 
erase diagnosticsfile.dta 
erase diagnosticsfile.smcl 
erase graphfile.gph
	
// Table 7: Mean-adjusted Abnormal Bid-Ask Spread

* All announcements
use cross_sp_all.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_all.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mentions
use cross_sp_mention.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_mention.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Mandates
use cross_sp_mandate.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_mandate.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First approvals
use cross_sp_fstapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_fstapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Revised approvals
use cross_sp_revisapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_revisapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final approvals
use cross_sp_fnlapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_fnlapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Sole approvals
use cross_sp_soleapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_soleapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* First-or-sole approvals
use cross_sp_fstsoapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_fstsoapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Final-or-sole approvals
use cross_sp_fnlsoapp.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_fnlsoapp.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

* Drawdowns
use cross_sp_draw.dta, clear
rename CAR1 CAAS
drop if CAAS==.
gen neg_CAAS=(CAAS<0)
tabstat neg_CAAS, stat(N sum mean)
use caas_sp_draw.dta, clear
rename CAARE CAAS
rename NCAAREBoehmer BMP_test
rename PCAAREBoehmer BMP_pval
rename NCAAREZivney_Cowan CZ_rank
rename PCAAREZivney_Cowan CZ_pval
list NoFirms CAAS BMP_test BMP_pval CZ_rank CZ_pval if _n==1

****************************************************************************
* CROSS-SECTIONAL ANALYSIS
****************************************************************************
	
// Merge event sample dataset with CAR dataset for cross-sectional analysis

use cross_all.dta, clear
destring fid, replace
keep id1 fid ticker CAR1
rename CAR1 CAR

merge 1:1 id1 using fstsoapp.dta, keep(match) nogen
sort fid id1
by fid: gen ann=_n
order ann, after(ann_id)
order dum id1
save fstsoapp1.dta, replace

// Compute stock volatility in year prior to event

use fstsoapp1.dta, clear
keep if ann==1
keep id1 fid Date
merge 1:1 fid Date using return.dta, keep(master match) keepusing(day) nogen
rename Date eventdate
rename day evdaynum
merge 1:n fid using return.dta, keep(match) nogen
rename Date caldate
sort fid caldate
by fid: gen evday=day-evdaynum
order evday, before(day)
by fid: gen prioryr=1 if evday<=-11 & evday>=-270
order prioryr, after(evday)
collapse (sd) volatility=lret if prioryr==1, by(fid)
gen ann=1
order ann, after(fid)
save v_1.dta, replace

use fstsoapp1.dta, clear
keep if ann==2
keep id1 fid Date
merge 1:1 fid Date using return.dta, keep(master match) keepusing(day) nogen
rename Date eventdate
rename day evdaynum
merge 1:n fid using return.dta, keep(match) nogen
rename Date caldate
sort fid caldate
by fid: gen evday=day-evdaynum
order evday, before(day)
by fid: gen prioryr=1 if evday<=-11 & evday>=-270
order prioryr, after(evday)
collapse (sd) volatility=lret if prioryr==1, by(fid)
gen ann=2
order ann, after(fid)
save v_2.dta, replace

use v_1.dta, clear
append using v_2
sort fid ann	
save volatility.dta, replace

erase v_1.dta 
erase v_2.dta

merge 1:1 fid ann using fstsoapp1.dta, keep(match) nogen
order id1
order ann, after(ann_id)
order volatility, after(spbank3)
label var volatility "Volatility"
rename Date eventdate

* Generate year dummies as control
gen yr06=(evyr==2006)
gen yr07=(evyr==2007)
gen yr11=(evyr==2011)

merge 1:1 id1 using loan_pricing.dta, keep(match) keepusing(currency) nogen
gen nonusdloan=(currency!="USD")
gen precious=(comm=="Precious")

save fstsoapp2.dta, replace

// Table 8: Determinants of market reactions to PF loan approvals

drop if loan == .

* Column 1
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret, r

* Column 2
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging, r

* Column 3
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu, r

* Column 4
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu nonbank, r

* Column 5
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu nonbank spbank1, r

* Column 6
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu nonbank spbank3, r
	 
// Unreported sensitivity analysis 

* Controlling for JV
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu jv, r

* Controlling for oil & gas projects
gen ong=(comm=="OG")

regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu ong, r

* Excluding oil & gas projects
drop if comm=="OG"
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu, r

* Excluding an outlier observation with LTD/TA ratio = 0.79
use fstsoapp2.dta, clear
drop if id1==268
regr CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret hedging gpu, r
	 
// Table 9: Propensity model of hedging

use fstsoapp2.dta, clear
drop if loan == .	

* Column 1
probit hedging precious spbank1 offtake nonusdloan mgnt_shdg ///
	 top20 crbret lnmve gpu cash_ta td_ta yr06 yr07 yr11, vce(r)

* Column 2	 
probit hedging precious spbank3 offtake nonusdloan mgnt_shdg ///
	 top20 crbret lnmve gpu cash_ta td_ta yr06 yr07 yr11, vce(r)	 	  
	 
// Table 10: Treatment effects model 

* Columns 1 and 2
etregress CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret gpu nonbank spbank1, ///
	 treat(hedging = precious spbank1 offtake nonusdloan mgnt_shdg top20 ///
	 crbret lnmve gpu cash_ta td_ta yr06 yr07 yr11) vce(r)

* Columns 3 and 4
etregress CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret gpu nonbank spbank3, ///
	 treat(hedging = precious spbank3 offtake nonusdloan mgnt_shdg top20 ///
	 crbret lnmve gpu cash_ta td_ta yr06 yr07 yr11) vce(r)

* Untabulated: Treatment effects model with geodistance included

merge 1:1 id1 using geodistance.dta, keep(match master) nogen
geodist lender_lat lender_long proj_lat proj_long, generate(lp_dist)
gen log_lpdist=ln(1+lp_dist)
	 
etregress CAR loan_ta syndic lender_eq eq_raise offtake lnmve volatility ///
	 top20 mgnt_shdg crbret gpu nonbank spbank1 log_lpdist, ///
	 treat(hedging = log_lpdist precious spbank1 offtake nonusdloan top20 ///
	 mgnt_shdg crbret lnmve gpu cash_ta td_ta yr06 yr07 yr11) vce(r)
	 
*****************************************************************************
* PF LOAN PRICING
*****************************************************************************
use loan_pricing.dta, clear
replace maturity = maturity/12   /* convert maturity from months to years */
gen lmaturity = ln(maturity)
gen sq_maturity = maturity*maturity
gen sqrt_maturity = sqrt(maturity) 

// Table 11: Summary statistics of PF loan pricing and maturity
tab base
tabstat base_rate spread loan_rate maturity, stat(N mean p50 sd min ///
	p10 p25 p75 p90 max) col(stat)

merge 1:1 id1 using fstsoapp2.dta, keep(match) nogen
gen lsize = ln(loan)   /* loan amounts are all converted to AUD */

// Table 12: Determinants of PF loan pricing

* Column 1	 
regr spread base_rate spbank1 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu, r 

* Column 2
regr spread base_rate spbank1 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity, r		

* Column 3	
regr spread base_rate spbank1 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity lmaturity, r		
* Column 4	
regr spread base_rate spbank1 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity ///
	yr06 yr07 yr11, r
	
* Untabulated: Controlling for spbank3
		 
regr spread base_rate spbank3 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu, r 	
	 
regr spread base_rate spbank3 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity, r	
 
regr spread base_rate spbank3 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity lmaturity, r		
regr spread base_rate spbank3 nonbank lsize syndic secured eq_raise offtake ///
	lnmve volatility top20 mgnt_shdg crbret hedging gpu maturity ///
	yr06 yr07 yr11, r	
 
*****************************************************************************
* Post-loan operating performance
*****************************************************************************
use post5_fin.dta, clear

// Table 13: Summary statistics of post-5yr operating performance 

keep if all_eq==0

* Panel A: Accounting performance
tabstat rev_ta oprev_ta ebit_ta npat_ta npat_bve, stat(N p50) col(stat)
tabstat rev1_ta oprev1_ta ebit1_ta npat1_ta npat1_bve, stat(N p50) col(stat)
tabstat rev2_ta oprev2_ta ebit2_ta npat2_ta npat2_bve, stat(N p50) col(stat)
tabstat rev3_ta oprev3_ta ebit3_ta npat3_ta npat3_bve, stat(N p50) col(stat)
tabstat rev4_ta oprev4_ta ebit4_ta npat4_ta npat4_bve, stat(N p50) col(stat)
tabstat rev5_ta oprev5_ta ebit5_ta npat5_ta npat5_bve, stat(N p50) col(stat)

* Panel B: Bankruptcy events
count if admin1==1
count if admin2==1
count if admin3==1
count if admin4==1
count if admin5==1
count if admin1_5==1
count if termin1==1
count if termin2==1
count if termin3==1
count if termin4==1
count if termin5==1
count if termin1_5==1
count if closure1==1
count if closure2==1
count if closure3==1
count if closure4==1
count if closure5==1
count if closure1_5==1
	
* Panel C: All-equity subsample accounting performance
use post5_fin.dta, clear
keep if all_eq==1
tabstat rev_ta oprev_ta ebit_ta npat_ta npat_bve, stat(N p50) col(stat)
tabstat rev1_ta oprev1_ta ebit1_ta npat1_ta npat1_bve, stat(N p50) col(stat)
tabstat rev2_ta oprev2_ta ebit2_ta npat2_ta npat2_bve, stat(N p50) col(stat)
tabstat rev3_ta oprev3_ta ebit3_ta npat3_ta npat3_bve, stat(N p50) col(stat)
tabstat rev4_ta oprev4_ta ebit4_ta npat4_ta npat4_bve, stat(N p50) col(stat)
tabstat rev5_ta oprev5_ta ebit5_ta npat5_ta npat5_bve, stat(N p50) col(stat)

// Univariate tests of accounting performance between PF and all-equity 
// subsamples (untabulated)	
use post5_fin.dta, clear
ranksum rev1_ta, by(all_eq)
ranksum rev2_ta, by(all_eq)	
ranksum rev3_ta, by(all_eq)	
ranksum rev4_ta, by(all_eq)	
ranksum rev5_ta, by(all_eq)

ranksum oprev1_ta, by(all_eq)
ranksum oprev2_ta, by(all_eq)	
ranksum oprev3_ta, by(all_eq)	
ranksum oprev4_ta, by(all_eq)	
ranksum oprev5_ta, by(all_eq)

ranksum ebit1_ta, by(all_eq)
ranksum ebit2_ta, by(all_eq)	
ranksum ebit3_ta, by(all_eq)	
ranksum ebit4_ta, by(all_eq)	
ranksum ebit5_ta, by(all_eq)

ranksum npat1_ta, by(all_eq)
ranksum npat2_ta, by(all_eq)	
ranksum npat3_ta, by(all_eq)	
ranksum npat4_ta, by(all_eq)	
ranksum npat5_ta, by(all_eq)

ranksum npat1_bve, by(all_eq)
ranksum npat2_bve, by(all_eq)	
ranksum npat3_bve, by(all_eq)	
ranksum npat4_bve, by(all_eq)	
ranksum npat5_bve, by(all_eq)

